from django.db import models

# Create your models here.

class Restaurant( models.Model):
    name = models.CharField( max_length = 100)
    TYPES = (
        ( 'fast-food', 'Fast Food'),
        ( 'sit-down', 'Sit-Down'),
        ( 'buffet', 'Buffet'),
    )
    type = models.CharField( max_length = 20, choices = TYPES)
    delivery = models.BooleanField()
    catering = models.BooleanField()
    website = models.URLField( verify_exists = False, max_length = 200, blank = True)
    def __unicode__( self):
        return self.name

class FoodType( models.Model):
    restaurant = models.ForeignKey( Restaurant)
    type = models.CharField( max_length = 100)
    category = models.CharField( max_length = 100)
    def __unicode__( self):
        return self.type

class Location( models.Model):
    restaurant = models.ForeignKey( Restaurant)
    intersection = models.CharField( max_length = 100)
    address = models.TextField( blank = True)
    phone = models.CharField( max_length = 14, blank = True)
    def __unicode__( self):
        return self.intersection

class Menu( models.Model):
    restaurant = models.ForeignKey( Restaurant)
    item = models.CharField( max_length = 100)
    description = models.TextField( blank = True)
    price = models.DecimalField( max_digits = 5, decimal_places = 2, blank = True)
    def __unicode__( self):
        return self.item

class Person( models.Model):
    name = models.CharField( max_length = 100)
    email = models.EmailField( blank = True)
    def __unicode__( self):
        return self.name

class RestaurantList( models.Model):
    restaurant = models.ForeignKey( Restaurant)
    person = models.ForeignKey( Person)
    date_visited = models.DateField()

